import java.util.Arrays;

public class javaBasic3 {
    public static void main(String[] args){
        String name = "justin";
        int age = 31;
        Object v1 = name;
        System.out.println(v1);
        v1 = age;
        System.out.println(v1);
        Person p = new Person();
        System.out.println(p);
        v1 = p;
        System.out.println(v1);

        //定义object 类型数组
        Object[] arrs = new Object[3];
        arrs[0] = "justin";
        arrs[1] = 10;
        arrs[2] = p;
        System.out.println(Arrays.toString(arrs));

        Object v2 = 10;
        System.out.println(v2.getClass());

        //通过判断确定类型
        Object v3 = 10;
        if(v3 instanceof Integer){
            System.out.println("v3是Integer类型");
            int i = (Integer) v3;
            System.out.println(i);
        }
    }


}

class Person{

}